@import '~antd/lib/style/themes/default.less';
@import '../../style/theme.less';
@import './mixin.less';
// @select-prefix-cls: ~'@{prefix}-select';
@tree-prefix-cls: ~'@{prefix}-tree';
.@{tree-prefix-cls} {
  .reset-component;
  &-menu {
    z-index: 50;
  }
  &-node {
    position: relative;
    padding: 0px 4px;
    overflow: hidden;
    color: @text-color;
    font-weight: normal;
    line-height: 22px;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: background 0.3s ease;
    display: none;
    &-open {
      display: block;
    }
    &-content-wrapper {
      display: inline-block;
      //扣去28 即 switcher 的宽度 24 + 4padding
      width: ~'calc(100% - 28px)';
      margin: 0;
      padding: 3px 5px;
      color: rgba(0, 0, 0, 0.65);
      text-decoration: none;
      border-radius: 2px;
      cursor: pointer;
      -webkit-transition: all 0.3s;
      transition: all 0.3s;
      &:hover:not(&-disabled) {
        background-color: @item-hover-bg;
      }
    }
    &:first-child {
      border-radius: @border-radius-base @border-radius-base 0 0;
    }

    &:last-child {
      border-radius: 0 0 @border-radius-base @border-radius-base;
    }
    &-selected {
      color: @text-color;
      font-weight: @select-item-selected-font-weight;
      background-color: @item-active-bg;
    }

    &-disabled {
      color: @disabled-color;
      cursor: not-allowed;
      &:hover {
        color: @disabled-color;
        cursor: not-allowed;
      }
    }
    span {
      &.@{tree-prefix-cls}-checkbox {
        margin: 0 4px 0 0;
        + .@{tree-prefix-cls}-node-content-wrapper {
          width: ~'calc(100% - 46px)';
        }
      }
      &.@{tree-prefix-cls}-switcher,
      &.@{tree-prefix-cls}-iconEle {
        display: inline-block;
        width: 24px;
        height: 24px;
        margin: 0;
        line-height: 22px;
        text-align: center;
        vertical-align: middle;
        border: 0 none;
        outline: none;
        cursor: pointer;
      }
      &.@{tree-prefix-cls}-icon_loading {
        .@{tree-prefix-cls}-switcher-loading-icon {
          position: absolute;
          left: 0;
          display: inline-block;
          color: @primary-color;
          font-size: 14px;
          transform: none;
          svg {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            margin: auto;
          }
        }
      }
      &.@{tree-prefix-cls}-switcher {
        position: relative;
        &.@{tree-prefix-cls}-switcher-noop {
          cursor: auto;
        }
        &.@{tree-prefix-cls}-switcher_open {
          .avTreeSwitcherIcon();
        }
        &.@{tree-prefix-cls}-switcher_close {
          .avTreeSwitcherIcon();
          .@{tree-prefix-cls}-switcher-icon {
            svg {
              transform: rotate(-90deg);
            }
          }
        }

        &.@{tree-prefix-cls}-switcher_open,
        &.@{tree-prefix-cls}-switcher_close {
          .@{tree-prefix-cls}-switcher-loading-icon {
            position: absolute;
            left: 0;
            display: inline-block;
            width: 24px;
            height: 24px;
            color: @primary-color;
            font-size: 14px;
            transform: none;
            svg {
              position: absolute;
              top: 0;
              right: 0;
              bottom: 0;
              left: 0;
              margin: auto;
            }
          }
        }
      }
    }
  }
}
